<template>
  <view class="container">
    <view class="uni-padding-wrap">
      <view class="uni-title">选择的日期：{{selectedDate}}</view>
    </view>
    <picker mode="date" :value="selectedDate" @change="onChange" class="date-picker">
      <button>选择日期</button>
    </picker>
  </view>
</template>

<script setup>
import { ref } from 'vue';

const selectedDate = ref('2023-01-01');

const onChange = (event) => {
  selectedDate.value = event.detail.value;
};
</script>

<style scoped>
.container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
}

.date-picker {
  margin-top: 20px;
}

button {
  padding: 10px 20px;
  background-color: #007aff;
  color: white;
  border-radius: 5px;
  border: none;
}
</style>
